<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<spring:message code="searchbox.detailtravellers_lbl" var="detailtravellers_lbl"/>
<spring:message code="searchbox.adults_lbl" var="adults_lbl"/>
<spring:message code="searchbox.children_lbl" var="children_lbl"/>
<spring:message code="searchbox.startdate_lbl" var="startdate_lbl"/>
<spring:message code="searchbox.destination_lbl" var="destination_lbl"/>
<spring:message code="searchbox.choose_destination_cb" var="choose_destination_cb"/>
<spring:message code="searchbox.holidayperiod_lbl" var="holidayperiod_lbl"/>
<spring:message code="searchbox.chooseamountdays_cb" var="chooseamountdays_cb"/>
<spring:message code="searchbox.showresults_btn" var="showresults_btn"/>

<form id="searchForm" class="searchDiv">
    <h4 class="searchDivSubject">${detailtravellers_lbl}</h4>
    <div class="form-group" >
        <label class="form-control-static searchDivLabel">${adults_lbl}</label>
        <input class="searchDivInput" type='number' value="2" />
    </div>
    <div class="form-group">
        <label class="form-control-static searchDivLabel">${children_lbl}</label>
        <input class="searchDivInput" type='number' value="0"/>
    </div>
    <h4 class="searchDivSubject">${startdate_lbl}</h4>
    <div class="form-group" >
        <label class="form-control-static searchDivLabel">Alle vertrekdata</label>
        <input class="searchDivInputDate" type='date' />
    </div>

    <h4 class="searchDivSubject">${destination_lbl}</h4>
    <div class="form-group">
        <select id="country_cb"> 
            <option value="0" selected>${choose_destination_cb}</option>
        </select>
    </div>
</form>

<script>
    $(document).ready(function () {
        $.ajax({
            url: window.location.origin + "/reisorg-cust-site/country/getall",
            type: "GET",
            dataType: 'json',
            success: function (data, textStatus, jqXHR)
            {
                $.each(data, function (key, value) {
                    $('<option>').val(value.id).text(value.name).appendTo('#country_cb');
                });
            },
            error: function (jqXHR, textStatus, errorThrown)
            {
                alert("Mislukt om een connectie met de server te maken");
            }
        });
    });
</script>